package com.daqian.cloud.client.demo3.controller;

import com.daqian.cloud.client.demo3.feign.Demo2ServiceFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author daqian
 * @date 2019/11/4 22:02
 */
@RestController
@RequestMapping("demo3")
public class Demo3Controller {

    @Autowired
    private Demo2ServiceFeign demo2ServiceFeign;

    /**
     * 192.168.0.5:8764/demo3/getStr/123hhh
     * @author daqian
     * @date 2019/11/4 22:32
     */
    @GetMapping("getStr/{str}")
    public String getDemoStr(@PathVariable("str") String str) {
        return demo2ServiceFeign.getDemoStr(str);
    }

    @GetMapping("test")
    public String test() {
        return "test demo3";
    }
}
